﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace FCP.Data.Migrations
{
    public partial class import : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "t_import",
                columns: table => new
                {
                    id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
                    code = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true),
                    name = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    edit_form_code = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true),
                    att_files = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),
                    remark = table.Column<string>(type: "character varying(600)", maxLength: 600, nullable: true),
                    org_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    create_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    modify_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    is_deleted = table.Column<bool>(type: "boolean", nullable: false),
                    row_version = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_import", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "t_import_detail",
                columns: table => new
                {
                    id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
                    import_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    edit_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    summary = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    sheet_index = table.Column<int>(type: "integer", nullable: false),
                    sheet_row_index = table.Column<int>(type: "integer", nullable: false),
                    sheet_key_field_name = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    num = table.Column<int>(type: "integer", nullable: false),
                    org_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    create_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    modify_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    is_deleted = table.Column<bool>(type: "boolean", nullable: false),
                    row_version = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_import_detail", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "t_import_field",
                columns: table => new
                {
                    id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
                    import_detail_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    edit_field_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    field_label = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
                    field_name = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    excel_field_name = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    excel_field_type = table.Column<int>(type: "integer", nullable: false),
                    is_primary = table.Column<bool>(type: "boolean", nullable: false),
                    num = table.Column<int>(type: "integer", nullable: false),
                    org_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    create_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    modify_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    is_deleted = table.Column<bool>(type: "boolean", nullable: false),
                    row_version = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_import_field", x => x.id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "t_import");

            migrationBuilder.DropTable(
                name: "t_import_detail");

            migrationBuilder.DropTable(
                name: "t_import_field");
        }
    }
}
